package base.day18.exception;

import java.util.Scanner;

public class Exception2 {
    public static void main(String[] args) {
        try {
            Scanner sc=new Scanner(System.in);
            System.out.println("请输入年龄：");
            String strage=sc.next();
            int age=Integer.parseInt(strage);
            System.out.println(age);
            System.out.println("测试123");
            System.out.println(2/0);
        }catch(NumberFormatException err){
            System.out.println("格式转换错误");
        }
        catch(ArithmeticException err2){
            System.out.println("除数不能为零");
        }
        System.out.println("测试456");

    }
}
